package tr3dtris.game.models;

/**
 * Class used to model a single block. More blocks are used to build pieces.
 * @author Luciano Mammino <loige@hotmail.com>
 * @author Andrea Mangano <kapitan0@hotmail.it>
 * @version 0.1
 * @since 0.1
 */
public class Block implements Cloneable
{
    /**
     * Default type constant. Type is used for display to difference
     * block using a different style (colour, texture , etc.) for
     * different types.
     */
    public static final int DEFAULT_TYPE = 0;

    /**
     * Block type
     */
    private int type;

    /**
     * Blank Constructor. Uses default type.
     */
    public Block()
    {
        this(DEFAULT_TYPE);
    }

    /**
     * Constructor
     * @param type type for this block
     */
    public Block(int type)
    {
        this.type = type;
    }

    /**
     * @return the type
     */
    public int getType() {
        return type;
    }

    /**
     * @param type the type to set
     */
    public void setType(int type) {
        this.type = type;
    }


    /**
     * {@inheritDoc}
     */
    @Override
    public Object clone()
    {
        return new Block(this.getType());
    }


}
